<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="stylesheet" type="text/css" href="<?php echo $baseurl?>public/theme/css/style.css"/>
        <link rel="stylesheet" type="text/css" href="<?php echo $baseurl?>public/theme/css/media.css"/>
        <script type="text/javascript" src="<?php echo $baseurl?>public/theme/js/jquery-1.10.2.min.js"></script>
        <script type="text/javascript" src="<?php echo $baseurl?>public/theme/js/jquery.alerts.js"></script>
        <?php if($controller == 'intro') :?>
        <script type="text/javascript" src="<?php echo $baseurl?>public/theme/js/custom-home.js"></script>
        <?php endif;?>
        <script type="text/javascript" src="<?php echo $baseurl?>public/theme/js/custom.js"></script>
        
    </head>
    <?php if($controller == 'intro'){$id = 'id="homepage"';}else if($controller == 'play' || $controller == 'off_play'){$id = 'id="gameshow"';}?>
    <body <?php echo @$id?>>
        <?php if($this->session->userdata('loadaudio') == 1):?>
        <audio autoplay>
            <source src="<?php echo $baseurl?>public/theme/audio/100.mp3" type="audio/mpeg">
        </audio>
        <?php endif;?>
        <?php if(!in_array($this->session->userdata('user_id'), array(null, ''. '0'))):?>
        <a id="logout" href="<?php echo $baseurl?>logout"><img alt="" src="<?php echo $baseurl?>public/theme/images/out.png"/></a>
        <?php endif;?>
        
        <?php if($controller != "off_play"):?>
			<!-- chart month-->
			<div id="chart-month">
            <?php $this->load->view('template/block/bxhthang');?>
			</div>

			<!-- chart current-->
			<div id="chart-current">
				<?php $this->load->view('template/block/bxh');?>
			</div>
		<?php else:?>
			<div id="chart-month">
            <?php $this->load->view('template/block/bxhoffline');?>
			</div>
		<?php endif;?>
        
        
        <?php if(@$result != '' || @validation_errors()):?>
        <!--popup-->
        <div id="popup"  class="active"  style="display: block;">
            <div class="bg-dialog"></div>
            <div class="dialog">
                <div class="popup_inside">
                    <article>
                        <p style="text-align: left">
                        <?php echo validation_errors();?>
                        <?php echo @$result;?>
                        </p>
                    </article>
                    <?php if(!in_array(@$dkm, array(null, '', '0'))):?>
                    <a href="<?php echo @$dkm->url?>" class="btn-ok-a"><?php echo @$dkm->label?></a>
                    <?php else:?>
                    <a href="#" class="btn-ok">Đồng ý</a>
                    <?php endif;?>
                </div>
            </div>
        </div>
        <?php endif;?>
        <?php if(in_array($action, array('account', 'errorpay'))):?>
        <!--popup-->
        <div id="popup" class="popupo2">
            <div class="bg-dialog"></div>
            <div class="dialog">
                <div class="popup_inside">
                    <article>
                        <p style="text-align: left">Để tham gia vào phòng chơi tương tác, các bạn cần soạn tin nhắn nạp xu tài khoản:</p>
                        <p><label>ION GS <?php echo $this->session->userdata('username');?>  gửi tới tổng đài 8738</label></p>
                    </article>
                    <a href="#" class="btn-ok">Đồng ý</a>
                </div>
            </div>
        </div>
        <?php endif;?>
        <div <?php echo $controller == 'intro' ? 'class="homewrap"' : 'class="mainwrap"'?>>
            <?php $this->load->view("template/".($controller ? $controller : 'index')."/".($action ? $action : 'index'),'');?>
        </div>
        
        <?php if($controller == 'intro') :?>
        <div id="light-1"></div>
        <div id="light-2"></div>
        <div id="light-3"></div>
        <div id="light-4"></div>
        <div id="light-5"></div>
        <?php endif;?>

    </body>
</html>